function show(a){
	document.getElementById(a).style.display="block";
}
function hide(a){
	document.getElementById(a).style.display="none";
}

function chuandi(e){
		var zhi=$(e).val();
		$.ajax(
				{
					url:"counselor/findCourseer.do",
					type:"post",
					dataType:"json",
					data:{
						chuanzhi:zhi
					},
					success:function(data){
						var a=$("select[name='coursename']");
						var s="<option>"+"请选择"+"</option>";
						$.each(data,function(index,item){
							s+="<option>"+item.courseName+"</option>";
						});
						a.html(s);
					},
					error:function(result){
						console.log("error:"+result);
					}
				}
			);
}

function chuandier(e){
	var zhi=$(e).val();
	var zhier=$("select[name='classname']").val();
	$.ajax(
			{
				url:"counselor/findTeacher.do",
				type:"post",
				dataType:"json",
				data:{
					chuanzhi:zhi,
					chuandier:zhier
				},
				success:function(data){
					if(data.length!=0){
						var s=$("input[name='tchname']");
						s.val(data.tchName);
					}else{
						var z=$(e).val();
						console.log(z);
						var s=$("input[name='tchname']");
						s.val(" ");
					}
					
				},
				error:function(result){
					console.log("error:"+result);
				}
			}
		);
}

function huanqu(){
		var zhi=$("input[name='conditions']").val();
		
	$.ajax(
			{
				url:"counselor/classevaluatinginfo.do",
				type:"post",
				dataType:"json",
				data:{
					ctions:zhi
				},
				success:function(data){
					console.log(data);
					
					var a="<tr class='tr-style-head'>";
						a+="<td>"+"课程名称"+"</td>";
						a+="<td>"+"班级名称"+"</td>";
						a+="<td>"+"老师名称"+"</td>";
						a+="<td>"+"创建时间"+"</td>";
						a+="<td>"+"评测开始时间"+"</td>";
						a+="<td>"+"评测结束时间"+"</td>";
						a+="<td>"+"评测实行状态"+"</td>";
						a+="<td>"+"评测表状态"+"</td>";
					a+="</tr>";
					$.each(data,function(index,item){
						var start=item.assessmentStartTime;
						var d=new Date(start);
						var date=(d.getFullYear())+"-"+
								(d.getMonth())+"-"+
								(d.getDate());
						
						var crti=item.createTime;
						var c=new Date(crti);
						var crtime=(c.getFullYear())+"-"+
									(c.getMonth())+"-"+
									(c.getDate());
						
						var endti=item.assessmentEndTime;
						var e=new Date(endti);
						var endtime=(e.getFullYear())+"-"+
									(e.getMonth())+"-"+
									(e.getDate());
						
						 a+="<tr  class='tr-style'>";
							a+="<td>"+item.courseName+"</td>";
							a+="<td>"+item.className+"</td>";
							a+="<td>"+item.tchName+"</td>";
							a+="<td>"+crtime+"</td>";
							a+="<td>"+date+"</td>";
							a+="<td>"+endtime+"</td>";
							a+="<td>"+item.assessmentFulfillState+"</td>";
							a+="<td>"+item.assessmentState+"</td>";
						a+="</tr>";
					});
					
					$("#tables").html(a);
				},
				error:function(data){
					console.log("error"+data);
				}
			}
	);
}

//教师
function abc(){
	var zhi=$("input[name='conditions']").val();
	
$.ajax(
		{
			url:"teacher/classevaluatinginfo.do",
			type:"post",
			dataType:"json",
			data:{
				ctions:zhi
			},
			success:function(data){
				console.log(data);
				
				var a="<tr class='tr-style-head'>";
					a+="<td>"+"课程名称"+"</td>";
					a+="<td>"+"班级名称"+"</td>";
					a+="<td>"+"老师名称"+"</td>";
					a+="<td>"+"创建时间"+"</td>";
					a+="<td>"+"评测开始时间"+"</td>";
					a+="<td>"+"评测结束时间"+"</td>";
					a+="<td>"+"评测实行状态"+"</td>";
					a+="<td>"+"评测表状态"+"</td>";
				a+="</tr>";
				$.each(data,function(index,item){
					var start=item.assessmentStartTime;
					var d=new Date(start);
					var date=(d.getFullYear())+"-"+
							(d.getMonth())+"-"+
							(d.getDate());
					
					var crti=item.createTime;
					var c=new Date(crti);
					var crtime=(c.getFullYear())+"-"+
								(c.getMonth())+"-"+
								(c.getDate());
					
					var endti=item.assessmentEndTime;
					var e=new Date(endti);
					var endtime=(e.getFullYear())+"-"+
								(e.getMonth())+"-"+
								(e.getDate());
					
					 a+="<tr  class='tr-style'>";
						a+="<td>"+item.courseName+"</td>";
						a+="<td>"+item.className+"</td>";
						a+="<td>"+item.tchName+"</td>";
						a+="<td>"+crtime+"</td>";
						a+="<td>"+date+"</td>";
						a+="<td>"+endtime+"</td>";
						a+="<td>"+item.assessmentFulfillState+"</td>";
						a+="<td>"+item.assessmentState+"</td>";
					a+="</tr>";
				});
				
				$("#tables").html(a);
			},
			error:function(data){
				console.log("error"+data);
			}
		}
);
}
